package cn.dao;

import cn.domain.User;
import cn.util.JDBCUtils;

/**
 * 操作数据库中表的类
 */
public class UserDao {

    //JDBCTemplate对象 公用
    private JdbcTemplate template = new JdbcTemplate (JDBCUtils.getDataSource());

    /**
     * 登录
     * @param loginUser
     * @return
     */
    public User login(User loginUser){
        String sql = "select * from user where name = ? and password = ?";
        User user = template.queryForObject(sql,
                new BeanPropertyRowMapper<user>(User.class),
        loginUser.getName(),loginUser.getPassword());


        return null;
    }

}
